/**
* 
* ====================================================================
*
* @author apov <apov@ymail.com>
*/ 
#pragma once

#include "BaseDefine.h"

extern "C"
{
#include "lua/lua.h"
#include "lua/lauxlib.h"
#include "lua/lualib.h"
}

class LuaGlue{
public:
	enum{
		DEF_ERR_CALL=				-1,
		DEF_ERR_UNKOWN_TYPE=		-2,
		DEF_ERR_TYPE=				-3,
	};

	int initialize( char* script );
	int call_va( const char* func, const char* sig, ... );
	int call_va( const char* func, int arg_count, const char* sig, ... );

	void stack_dump( char* name = 0 );

	LuaGlue();
	virtual ~LuaGlue();

protected:

private:
	lua_State* L_;
};
